// TestResultCreateDTO.java
package com.lufei.message_system.Data.TestResultVD;

import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;
import java.util.Date;

@Data
@Schema(name = "测试结果创建DTO")
public class TestResultCreateDTO {
    @JsonProperty("userId")
    @Schema(description = "用户ID", example = "2023000001")
    private String userId;

    @JsonProperty("testTime")
    @Schema(description = "测试完成时间", example = "2023-08-01T12:00:00Z")
    private Date testTime;

    @JsonProperty("eScore")
    @Schema(description = "外向(E)得分", example = "75")
    private Integer eScore;


    @JsonProperty("iScore")
    @Schema(description = "内向(I)得分", example = "25")
    private Integer iScore;

    @JsonProperty("sScore")
    @Schema(description = "实感(S)得分", example = "60")
    private Integer sScore;

    @JsonProperty("nScore")
    @Schema(description = "直觉(N)得分", example = "40")
    private Integer nScore;

    @JsonProperty("tScore")
    @Schema(description = "思考(T)得分", example = "70")
    private Integer tScore;

    @JsonProperty("fScore")
    @Schema(description = "情感(F)得分", example = "30")
    private Integer fScore;

    @JsonProperty("jScore")
    @Schema(description = "判断(J)得分", example = "65")
    private Integer jScore;

    @JsonProperty("pScore")
    @Schema(description = "感知(P)得分", example = "35")
    private Integer pScore;

    @JsonProperty("mbtiType")
    @NotBlank(message = "MBTI类型不能为空")
    @Pattern(regexp = "^(INTJ|INTP|ENTJ|ENTP|INFJ|INFP|ENFJ|ENFP|ISFJ|ISFP|ESFJ|ESFP|ISTJ|ISTP|ESTJ|ESTP)$",
            message = "MBTI类型必须是有效的4字母组合")
    @Schema(description = "MBTI类型", requiredMode = Schema.RequiredMode.REQUIRED,
            example = "INTJ", allowableValues = {
            "INTJ", "INTP", "ENTJ", "ENTP", "INFJ", "INFP",
            "ENFJ", "ENFP", "ISFJ", "ISFP", "ESFJ", "ESFP",
            "ISTJ", "ISTP", "ESTJ", "ESTP"})
    private String mbtiType;

    @JsonProperty("typeName")
    @NotBlank(message = "类型名称不能为空")
    @Size(max = 50, message = "类型名称长度不能超过50个字符")
    @Pattern(regexp = "^(建筑师|逻辑学家|指挥官|辩论家|调停者|保护者|探险家|观察者|成就者|执行者|监督者|协调者|分析者|创新者|管理员|企业家)$", message = "类型名称必须是允许的16种类型之一")
    @Schema(description = "类型名称（支持精确查询）", example = "建筑师",
            allowableValues = {"建筑师", "逻辑学家", "指挥官", "辩论家", "调停者", "保护者", "探险家", "观察者", "成就者", "执行者", "监督者", "协调者", "分析者", "创新者", "管理员", "企业家"})
    private String typeName;
}